program attack;
uses crt;
var
	blood1, blood2 : integer;
	corrent : boolean = true;
	damage : integer;
begin
	randomize;
	writeln('无尽袭击');
	writeln('infinity attack');
	delay(500);
	textcolor(15);
	blood1 := random(100) + 100;
	blood2 := random(100) + 100;
	writeln('我方属性：水，血量：', blood1);
	writeln('敌方属性：火，血量：', blood2);
	delay(500);
	writeln('战斗开始！');
	while (blood1 > 0) and (blood2 > 0) do
	begin
		delay(500);
		damage := random(5) + 1;
		if corrent then
		begin
			textcolor(11);
			blood2 := blood2 - damage;
			writeln('我方使用水能量发动攻击，敌方受到', damage, '点伤害！');
		end
		else
		begin
			textcolor(12);
			blood1 := blood1 - damage;
			writeln('敌方使用火能量发动攻击，我方受到', damage, '点伤害！');
		end;
		writeln('我方剩余血量：', blood1);
		writeln('敌方剩余血量：', blood2);
		corrent := not corrent;
	end;
	if blood1 > 0 then
		writeln('敌方倒下了！我方胜利！！')
	else
		writeln('我方倒下了。我方失败…………')
end.
